package com.yanqu.road.server.timer;

import com.yanqu.road.logic.helper.CrossChannelHelper;
import com.yanqu.road.server.cross3server.timer.Cross3EnterNameTask;
import com.yanqu.road.server.manager.activity.daomu.pvp.task.*;
import com.yanqu.road.server.manager.activity.feast.task.*;
import com.yanqu.road.server.manager.activity.hsisland.task.*;
import com.yanqu.road.server.manager.activity.jiuzhou.task.*;
import com.yanqu.road.server.manager.kuang.task.CrossKuangBattleTask;
import com.yanqu.road.server.manager.tomb.timer.TombPathMergeTask;
import com.yanqu.road.server.manager.tomb.timer.TombTask;
import com.yanqu.road.server.timer.chefduel.*;
import com.yanqu.road.server.timer.channelmusicroomrank.CrossChannelMusicRoomRankTask;
import com.yanqu.road.server.timer.chuhan.CrossChuHanTimerTask;
import com.yanqu.road.server.timer.cookboy.CookBoy2SyncTimerTask;
import com.yanqu.road.server.timer.dataanalytics.Cross2DataAnalyticsTask;
import com.yanqu.road.server.timer.expire.CrossSyncPendingMapTimerTask;
import com.yanqu.road.server.timer.feast.*;
import com.yanqu.road.server.timer.fivehero.FiveHeroSyncTask;
import com.yanqu.road.server.timer.flowerstudy.CrossFlowerStudyFinishRoomTask;
import com.yanqu.road.server.timer.flowerstudy.CrossFlowerStudySessionChangeTask;
import com.yanqu.road.server.timer.flowerstudy.CrossFlowerStudyStartRoomTask;
import com.yanqu.road.server.timer.jinli.CrossJinLiDrawTask;
import com.yanqu.road.server.timer.musicroomrank.CrossMusicRoomRankTask;
import com.yanqu.road.server.timer.log.CrossAutoLogSaveTask;
import com.yanqu.road.server.timer.newmonopolymarker.CrossNewMonopolyMarketTask;
import com.yanqu.road.server.timer.peakstronghold.*;
import com.yanqu.road.server.timer.servermallbuy.CrossMallDayBuyTask;
import com.yanqu.road.server.timer.sonhai.*;
import com.yanqu.road.server.timer.summergames.CrossSummerGamesTask;
import com.yanqu.road.server.timer.summerquiz.CrossSummerQuizTask;
import com.yanqu.road.server.timer.tonbing.CrossTonBingTimerTask;
import com.yanqu.road.server.timer.twins.CrossTwinsFastTimerTask;
import com.yanqu.road.server.timer.twins.CrossTwinsSlowTimerTask;
import com.yanqu.road.server.timer.dunhuangshiku.CrossDunHuangShiKuGetActiveUserInfoTask;
import com.yanqu.road.server.timer.union.CrossUnionMaxAbilitySyncTask;
import com.yanqu.road.server.timer.xingyoushanshui.XingYouShanShuiSettleTask;
import com.yanqu.road.server.timer.xingyoushanshui.XingYouShanShuiSyncTask;
import com.yanqu.road.server.timer.xingyoushanshui.XingYouShanShuiTask;
import com.yanqu.road.server.timer.xiuxian.*;
import com.yanqu.road.server.timer.xiuxian.CrossXiuXianCampScoreSyncTask;
import com.yanqu.road.server.timer.xiuxian.CrossXiuXianGenCampTask;
import com.yanqu.road.server.timer.xiuxian.CrossXiuXianMountAllotTask;
import com.yanqu.road.server.timer.xiuxian.CrossXiuXianSeizePlaceTask;
import com.yanqu.road.server.timer.xiuxian.CrossXiuXianSyncMountAllotTask;
import com.yanqu.road.server.timer.zhenhuan.CrossZhenHuanPromotionTask;
import com.yanqu.road.server.timer.zhenhuan.thirdProcess.CrossZhenHuanThirdProcessBanquetLogicTask;
import com.yanqu.road.server.timer.zhenhuan.thirdProcess.CrossZhenHuanThirdProcessBanquetSyncTask;
import com.yanqu.road.server.timer.zhenhuan.thirdProcess.CrossZhenHuanThirdProcessDebugTask;
import com.yanqu.road.task.CheckDeadLockTask;
import com.yanqu.road.task.DirectMemoryMonitorTask;
import com.yanqu.road.server.CrossBattleServer;
import com.yanqu.road.server.TempServer;
import com.yanqu.road.server.manager.activity.yearMaster.task.YearMasterExpiredTask;
import com.yanqu.road.server.manager.log.LogSaveTask;
import com.yanqu.road.server.timer.activity.*;
import com.yanqu.road.server.timer.banquet.GoodBanquetSettlementTask;
import com.yanqu.road.server.timer.banquet.GoodBanquetSynTask;
import com.yanqu.road.server.timer.cookboy.CookBoyNoticeTimerTask;
import com.yanqu.road.server.timer.cookboy.CookBoyTimerTask;
import com.yanqu.road.server.cross3server.timer.CheckCross3ChannelConnTask;
import com.yanqu.road.server.cross3server.timer.Cross3XServerNameTask;
import com.yanqu.road.server.timer.dafuweng.DFWUnionAdditionTask;
import com.yanqu.road.server.timer.dafuweng.DfwSyncDollTask;
import com.yanqu.road.server.timer.ghost.GhostGetAbilityTask;
import com.yanqu.road.server.timer.ghost.GhostSyncPlayerActionTask;
import com.yanqu.road.server.timer.cross.battle.timer.task.HuaShiGangGetAbilityTask;
import com.yanqu.road.server.timer.dafuweng.DaFuWengCleanTask;
import com.yanqu.road.server.timer.log.CrossActivityLogSaveTask;
import com.yanqu.road.server.timer.orewar.OreWarTimerTask;
import com.yanqu.road.server.timer.orewar.SyncOreWarRankTask;
import com.yanqu.road.server.timer.orewar.SyncOreWarUnionRankTask;
import com.yanqu.road.server.timer.rankunionwar.CrossRankUnionWarTimerTask;
import com.yanqu.road.server.timer.scene.SyncPlayerSceneActionTask;
import com.yanqu.road.server.timer.seacraftsouthsea.SeacraftSouthSeaLockPromotionTask;
import com.yanqu.road.server.timer.shuihu.ShuiHuSyncDrawTask;
import com.yanqu.road.server.timer.sprignIDinner.SpringDinnerSyncTask;
import com.yanqu.road.server.timer.stronghold.CrossActivityUnionConditionRankSyncTask;
import com.yanqu.road.server.timer.stronghold.StrongholdRefreshBoxTask;
import com.yanqu.road.server.timer.tongbing.CrossTongBingTimerTask;
import com.yanqu.road.server.timer.tradewar.SyncTradeWarRankTask;
import com.yanqu.road.server.timer.tradewar.SyncTradeWarUnionRankTask;
import com.yanqu.road.server.timer.tradewar.TradeWarResetTask;
import com.yanqu.road.server.timer.union.CrossUnionHonorsRewardSendTask;
import com.yanqu.road.server.timer.unionwar.*;
import com.yanqu.road.server.cross3server.timer.Cross3XRankTask;
import com.yanqu.road.server.timer.zerotime.CrossZeroTimeTask;
import com.yanqu.road.utils.executor.GeneralTask;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * 所有的定时器写在这边
 */
public class Cross2TimerMgr {

    private static final Logger logger = LogManager.getLogger(Cross2TimerMgr.class.getName());
    public static final int ALL_SYNC_TIME = 300000;      //5min全同步

    private static ScheduledExecutorService timerExecutorService;
    private static MgrDataSaveTask mgrDataSaveTask = null;

    private static MgrRemoveDataTask mgrRemoveDataTask = null;

	private static ConnectionCheckTask connectionCheckTask = null;
	private static CheckCross3ChannelConnTask checkCross3ChannelConnTask = null;

    private static HuaShiGangGetAbilityTask huaShiGangGetAbilityTask = null;

    private static YearMasterExpiredTask yearMasterExpiredTask = null;

    private static SyncActivityRankTask syncActivityRankTask = null;

    private static SyncActivityUnionRankTask syncActivityUnionRankTask = null;

    private static SyncActivityServerRankTask syncActivityServerRankTask = null;


    private static SyncTradeWarRankTask syncTradeWarRankTask = null;

    private static SyncTradeWarUnionRankTask syncTradeWarUnionRankTask = null;

    private static TradeWarResetTask tradeWarResetTask = null;

    private static OreWarTimerTask oreWarTimerTask = null;

    private static SyncOreWarRankTask syncOreWarRankTask = null;

    private static SyncOreWarUnionRankTask syncOreWarUnionRankTask = null;

    private static SyncActivityNewRankTask syncActivityNewRankTask = null;

    private static CrossActivityUnionConditionRankSyncTask crossActivityUnionConditionRankSyncTask;

    private static StrongholdRefreshBoxTask strongholdRefreshBoxTask;

    private static CrossZeroTimeTask crossZeroTimeTask = null;

    private static DaFuWengCleanTask daFuWengCleanTask = null;

    //商会战
    private static SyncUnionWarGuessTask syncUnionWarGuessTask = null;
    private static CalcUnionWarGuessAchieveCountTask calcUnionWarGuessAchieveCountTask = null;
    private static AddUnionWarChampionTask addUnionWarChampionTask = null;
    private static UnionWarBattleCheckTask unionWarBattleCheckTask = null;
    private static SyncUnionWarRankTask syncUnionWarRankTask = null;
    private static InitUnionWarGuessTask initUnionWarGuessTask = null;
//    private static SyncAllCrossUnionDetailTask syncAllCrossUnionDetailTask = null;

    // 水浒卡
    private static ShuiHuSyncDrawTask shuiHuSyncDrawTask = null;

    private static DirectMemoryMonitorTask directMemoryMonitorTask;


    // 鬼市
    private static GhostGetAbilityTask ghostGetAbilityTask = null;
    private static GhostSyncPlayerActionTask ghostSyncPlayerActionTask = null;
//    private static GhostCleanOldDataTask ghostCleanOldDataTask = null;
    private static CmdStatisticsTask cmdStatisticsTask;

    //弹幕
    private static BulletScreenTask bulletScreenTask = null;

    // 日志
    private static LogSaveTask logSaveTask = null;

    private static CookBoyTimerTask cookBoyTimerTask = null;
    private static ChefDuelTimerTask chefDuelTimerTask = null;
    private static ChefDuelWinUpTimerTask chefDuelWinUpTimerTask = null;

    private static SpringDinnerSyncTask springDinnerTimerTask = null;

    // 场景
    private static SyncPlayerSceneActionTask syncPlayerSceneActionTask = null;
    private static CookBoyNoticeTimerTask cookBoyNoticeTimerTask = null;
    private static CookBoy2SyncTimerTask cookBoy2SyncTimerTask = null;

    //厨神对局
    private static ChefDuel3NoticeTimerTask chefDuelNoticeTimerTask = null;
    private static ChefDuel2SyncTimerTask chefDuel2SyncTimerTask = null;
    private static ChefDuel2TimerTask chefDuel2TimerTask = null;

    // 百福宴
    private static GoodBanquetSettlementTask goodBanquetSettlementTask = null;
    private static GoodBanquetSynTask goodBanquetSynTask = null;
    // 海上争霸
    private static SeacraftSouthSeaLockPromotionTask seacraftSouthSeaLockPromotionTask = null;

    // 跨区域榜上传
    private static Cross3XRankTask cross3XRankTask = null;
    // 跨地区区服名称
    private static Cross3XServerNameTask cross3XServerNameTask = null;
    //
    private static Cross3EnterNameTask cross3EnterNameTask = null;

    private static CrossXUserBaseInfoClearTask crossXUserBaseInfoClearTask = null;

    private static DFWUnionAdditionTask dfwUnionAdditionTask;

    private static CrossActivityLogSaveTask crossActivityLogSaveTask;

    private static DfwSyncDollTask dfwSyncDollTask;

    private static CrossUnionActivityTaskTask crossUnionActivityTaskTask;

    private static CrossUnionHonorsRewardSendTask unionHonorsRewardSendTask = null;

    private static CrossTongBingTimerTask crossTongBingTimerTask;

    private static CrossChuHanTimerTask crossChuHanTimerTask;

    private static CrossTonBingTimerTask crossTonBingTimerTask;

    private static CrossRankUnionWarTimerTask crossRankUnionWarTask;

    private static TombTask tombTask;

    private static TombPathMergeTask tombPathMergeTask;
    private static CrossSyncPendingMapTimerTask syncPendingMapTimerTask;

    private static CrossTwinsFastTimerTask crossTwinsFastTimerTask;
    private static CrossTwinsSlowTimerTask crossTwinsSlowTimerTask;

    private static CrossDunHuangShiKuGetActiveUserInfoTask dunHuangShiKuGetActiveUserInfoTask;

    private static CrossPeakStrongholdStageChangeTask peakStrongholdStageChangeTask;
    private static CrossPeakStrongholdCreateDefendTask peakStrongholdCreateDefendTask;
    private static CrossPeakStrongholdTimerSyncTask peakStrongholdSyncTask;
    private static CrossPeakStrongholdRankSortTask peakStrongholdRankSortTask;

    private static CrossLionDanceTask lionDanceTask;

    private static CrossLangYaMemorialTask langYaMemorialTask;

    private static ConditionSyncTask conditionTimerTask = null;

    private static AdvanceLoadActivityTask advanceLoadActivityTask;

    private static CrossXiuXianSyncPlaceUserDataTask crossXiuXianSyncPlaceUserDataTask;
    private static CrossXiuXianSyncRoomOpTask crossXiuXianSyncRoomOpTask;
    private static CrossXiuXianSyncMountAllotTask crossXiuXianSyncMountAllotTask;
    private static CrossXiuXianSyncAttackTask crossXiuXianSyncAttackTask;
    private static CrossXiuXianSeizePlaceTask crossXiuXianSeizePlaceTask;
    private static CrossXiuXianPvpLockDataTask crossXiuXianPvpLockDataTask;
    private static CrossXiuXianPvpActivityCheckTask crossXiuXianPvpActivityCheckTask;
    private static CrossXiuXianPlaceSeizeProduceTask crossXiuXianPlaceSeizeProduceTask;
    private static CrossXiuXianMountAllotTask crossXiuXianMountAllotTask;
    private static CrossXiuXianGetServerScoreTask crossXiuXianGetServerScoreTask;
    private static CrossXiuXianCheckPlacePingTask crossXiuXianCheckPlacePingTask;
    private static CrossXiuXianCampScoreSyncTask crossXiuXianCampScoreSyncTask;
    private static CrossXiuXianGenCampTask crossXiuXianGenCampTask;
    private static CrossXiuXianNpcActionTask crossXiuXianNpcActionTask;

    private static CrossFeastSyncRoomOpTask crossFeastSyncRoomOpTask;
    private static CrossFeastSyncAttackTask crossFeastSyncAttackTask;
    private static CrossFeastPvpRobotTask crossFeastPvpLockDataTask;
    private static CrossFeastCheckPlacePingTask crossFeastCheckPlacePingTask;
    private static FeastPvpSyncPositionTask feastPvpSyncPositionTask;
    private static FeastPvpReviveTask feastPvpReviveTask;
    private static FeastPvpTask feastPvpTask;
    private static FeastCheckUserCollisionTask feastCheckBulletCollisionTask;
    private static CrossFeastMountAllotTask crossFeastMountAllotTask;
    private static FeastOutputTask feastOutputTask;
    private static CrossFeastPvpNpcTask crossFeastPvpNpcTask;
    private static CrossFeastSyncMountAllotTask crossFeastSyncMountAllotTask;

    private static CrossUnionMaxAbilitySyncTask crossUnionMaxAbilitySyncTask;

    private static FiveHeroSyncTask fiveHeroSyncTask;

    private static CrossKuangBattleTask crossKuangBattleTask;

    private static CrossFlowerStudyStartRoomTask crossFlowerStudyStartRoomTask;

    private static CrossFlowerStudyFinishRoomTask crossFlowerStudyFinishRoomTask;
    private static DaoMuPvpTask daoMuPvpTask;
    private static DaoMuCheckBulletCollisionTask daoMuCheckBulletCollisionTask;

    private static DaoMuCheckMonsterCollisionTask daoMuCheckMonsterCollisionTask;
    private static DaoMuCreateBulletTask daoMuCreateBulletTask;
    private static DaoMuPvpNpcTask daoMuPvpNpcTask;

    private static DaoMuPvpRefreshGoodsTask daoMuPvpRefreshGoodsTask;
    private static DaoMuPvpRecycleGoodsTask daoMuPvpRecycleGoodsTask;

    private static DaoMuPvpReviveTask daoMuPvpReviveTask;

    private static DaoMuPvpRoomTask daoMuPvpRoomTask;

    private static DaoMuPvpAliveRankChangeTask daoMuPvpAliveRankChangeTask;

    private static DaoMuPvpSyncPositionTask daoMuPvpSyncPositionTask;

    private static DaoMuPvpSyncRemoveRoomItemTask daoMuPvpSyncRemoveRoomItemTask;


    private static CrossFlowerStudySessionChangeTask crossFlowerStudySessionChangeTask;

    private static CrossNewMonopolyMarketTask newMonopolyMarketTask = null;

    private static CrossJinLiDrawTask crossJinLiDrawTask = null;

    private static CrossMusicRoomRankTask crossMusicRoomRankTask = null;

    private static CrossJiuZhouDebugTask crossJiuZhouDebugTask = null;
    private static CrossJiuZhouRoomLogicTask crossJiuZhouRoomLogicTask = null;
    private static CrossJiuZhouStageTask crossJiuZhouStageTask = null;
    private static CrossJiuZhouCheckGuessResultTask crossJiuZhouCheckGuessResultTask = null;
    private static CrossJiuZhouReleaseMemoryTask crossJiuZhouReleaseMemoryTask = null;
    private static CrossJiuZhouPopularitySyncTask crossJiuZhouPopularitySyncTask = null;

    private static CrossMallDayBuyTask crossMallDayBuyTask = null;

    private static CrossAutoLogSaveTask crossAutoLogSaveTask = null;

    private static CrossZhenHuanPromotionTask zhenHuanPromotionTask = null;

    private static CrossZhenHuanThirdProcessDebugTask zhenHuanThirdProcessDebugTask = null;
    private static CrossZhenHuanThirdProcessBanquetLogicTask zhenHuanThirdProcessBanquetLogicTask = null;
    private static CrossZhenHuanThirdProcessBanquetSyncTask zhenHuanThirdProcessBanquetSyncTask = null;

    private static CrossZhenHuanSecondProcessTask zhenHuanSecondProcessTask = null;

    private static CrossBiaoJuTask crossBiaoJuTask = null;
    private static CrossBiaoJuRankTask crossBiaoJuRankTask = null;

    private static Cross2DataAnalyticsTask cross2DataAnalyticsTask = null;

    private static CheckDeadLockTask checkDeadLockTask = null;

    private static CrossSummerQuizTask crossSummerQuizTask;

    private static CrossSummerGamesTask crossSummerGamesTask;

    private static XingYouShanShuiTask xingYouShanShuiTask;
    private static XingYouShanShuiSyncTask xingYouShanShuiSyncTask;
    private static XingYouShanShuiSettleTask xingYouShanShuiSettleTask;

    //山海伏兽
    private static SonHaiDailyResetEggTask sonHaiDailyResetEggTask = null;
    private static SonHaiNotifyServerSyncVipAveTask sonHaiNotifyServerSyncVipAveTask = null;
    private static SonHaiSyncUpdateTeamScoreTask sonHaiSyncUpdateTeamScoreTask = null;
    private static SonHaiBfEggRewardTask sonHaiBfEggRewardTask = null;
    private static SonHaiRestRegionTask sonHaiRestRegionTask = null;

    //海神岛
    private static CrossHsIslandDebugTask crossHsIslandDebugTask = null;
    private static CrossHsIslandBossTask crossHsIslandBossTask = null;
    private static CrossHsIslandBattleFieldSyncTask crossHsIslandBattleFieldSyncTask = null;
    private static CrossHsIslandUpdateUnionAcEndActivityTask crossHsIslandUpdateUnionAcEndActivityTask = null;
    private static CrossHsIslandBattleFieldCleanTask crossHsIslandBattleFieldCleanTask = null;
    private static CrossHsIslandSendRewardTask crossHsIslandSendRewardTask = null;

    //小马快跑
    private static CrossHorseRunTask crossHorseRunTask = null;

    //跨域妙音坊冲榜
    private static CrossChannelMusicRoomRankTask crossChannelMusicRoomRankTask = null;

    public static synchronized boolean initGeneralTimers(int serverType) {
        timerExecutorService = TempServer.getTimerExecutorService();

        int interval = 5;
        if (null == mgrDataSaveTask) {
            mgrDataSaveTask = new MgrDataSaveTask();
            timerExecutorService.scheduleWithFixedDelay(mgrDataSaveTask, 0, 60, TimeUnit.SECONDS);
        }

        if (null == mgrRemoveDataTask){
            mgrRemoveDataTask = new MgrRemoveDataTask();
            timerExecutorService.scheduleWithFixedDelay(mgrRemoveDataTask, 0, 600, TimeUnit.SECONDS);
        }

        if (null == connectionCheckTask) {
            connectionCheckTask = new ConnectionCheckTask(serverType);
            timerExecutorService.scheduleWithFixedDelay(connectionCheckTask, 5, 5, TimeUnit.SECONDS);
        }


    /*    if (null == syncActivityRankTask) {
            syncActivityRankTask = new SyncActivityRankTask();
            timerExecutorService.scheduleWithFixedDelay(syncActivityRankTask, 10, 5, TimeUnit.SECONDS);
        }*/

        if (null == syncActivityUnionRankTask) {
            syncActivityUnionRankTask = new SyncActivityUnionRankTask();
            timerExecutorService.scheduleWithFixedDelay(syncActivityUnionRankTask, 10, 5, TimeUnit.SECONDS);
        }

        if (null == syncActivityServerRankTask) {
            syncActivityServerRankTask = new SyncActivityServerRankTask();
            timerExecutorService.scheduleWithFixedDelay(syncActivityServerRankTask, 10, 5, TimeUnit.SECONDS);
        }


   /*     if (null == syncTradeWarRankTask) {
            syncTradeWarRankTask = new SyncTradeWarRankTask();
            timerExecutorService.scheduleWithFixedDelay(syncTradeWarRankTask, 10, 5, TimeUnit.SECONDS);
        }*/

      /*  if (null == syncTradeWarUnionRankTask) {
            syncTradeWarUnionRankTask = new SyncTradeWarUnionRankTask();
            timerExecutorService.scheduleWithFixedDelay(syncTradeWarUnionRankTask, 10, 5, TimeUnit.SECONDS);
        }*/

        if (null == tradeWarResetTask) {
            tradeWarResetTask = new TradeWarResetTask();
            timerExecutorService.scheduleWithFixedDelay(tradeWarResetTask, 10, 3, TimeUnit.SECONDS);
        }

        if (null == oreWarTimerTask) {
            oreWarTimerTask = new OreWarTimerTask();
            timerExecutorService.scheduleWithFixedDelay(oreWarTimerTask, 10, 3, TimeUnit.SECONDS);
        }

       /* if (null == syncOreWarRankTask) {
            syncOreWarRankTask = new SyncOreWarRankTask();
            timerExecutorService.scheduleWithFixedDelay(syncOreWarRankTask, 10, 5, TimeUnit.SECONDS);
        }*/

   /*     if (null == syncOreWarUnionRankTask) {
            syncOreWarUnionRankTask = new SyncOreWarUnionRankTask();
            timerExecutorService.scheduleWithFixedDelay(syncOreWarUnionRankTask, 10, 5, TimeUnit.SECONDS);
        }*/

    /*    if (null == syncActivityNewRankTask) {
            syncActivityNewRankTask = new SyncActivityNewRankTask();
            timerExecutorService.scheduleWithFixedDelay(syncActivityNewRankTask, 10, 5, TimeUnit.SECONDS);
        }*/

        if (null == huaShiGangGetAbilityTask) {
            huaShiGangGetAbilityTask = new HuaShiGangGetAbilityTask();
            timerExecutorService.scheduleWithFixedDelay(huaShiGangGetAbilityTask, 0, 60, TimeUnit.SECONDS);
        }

        if (null == yearMasterExpiredTask) {
            yearMasterExpiredTask = new YearMasterExpiredTask();
            timerExecutorService.scheduleWithFixedDelay(huaShiGangGetAbilityTask, 0, 24, TimeUnit.HOURS);
        }

        if (null == crossActivityUnionConditionRankSyncTask) {
            // 这是据点战的 先不能删除
            crossActivityUnionConditionRankSyncTask = new CrossActivityUnionConditionRankSyncTask();
            timerExecutorService.scheduleWithFixedDelay(crossActivityUnionConditionRankSyncTask, 10, 10, TimeUnit.SECONDS);
        }
        if (null == strongholdRefreshBoxTask) {
            strongholdRefreshBoxTask = new StrongholdRefreshBoxTask();
            timerExecutorService.scheduleWithFixedDelay(strongholdRefreshBoxTask, 0, 2, TimeUnit.SECONDS);
        }

        if (null == crossZeroTimeTask) {
            crossZeroTimeTask = new CrossZeroTimeTask();
            timerExecutorService.scheduleWithFixedDelay(crossZeroTimeTask, 15, 15, TimeUnit.SECONDS);
        }
        if (null == daFuWengCleanTask) {
            daFuWengCleanTask = new DaFuWengCleanTask();
            timerExecutorService.scheduleWithFixedDelay(daFuWengCleanTask, 30, 30, TimeUnit.SECONDS);
        }

        if(null == unionWarBattleCheckTask){
            unionWarBattleCheckTask = new UnionWarBattleCheckTask();
            timerExecutorService.scheduleWithFixedDelay(unionWarBattleCheckTask, 0, 1, TimeUnit.SECONDS);
        }

        if (null == syncUnionWarRankTask) {
            syncUnionWarRankTask = new SyncUnionWarRankTask();
            timerExecutorService.scheduleWithFixedDelay(syncUnionWarRankTask, 10, 10, TimeUnit.SECONDS);
        }

        if (null == initUnionWarGuessTask) {
            initUnionWarGuessTask = new InitUnionWarGuessTask();
            timerExecutorService.scheduleWithFixedDelay(initUnionWarGuessTask, 10, 30, TimeUnit.SECONDS);
        }

        if (null == syncUnionWarGuessTask) {
            syncUnionWarGuessTask = new SyncUnionWarGuessTask();
            timerExecutorService.scheduleWithFixedDelay(syncUnionWarGuessTask, 10, 5, TimeUnit.SECONDS);
        }

        if (null == calcUnionWarGuessAchieveCountTask) {
            calcUnionWarGuessAchieveCountTask = new CalcUnionWarGuessAchieveCountTask();
            timerExecutorService.scheduleWithFixedDelay(calcUnionWarGuessAchieveCountTask, 10, 5, TimeUnit.SECONDS);
        }

        if (null == addUnionWarChampionTask) {
            addUnionWarChampionTask = new AddUnionWarChampionTask();
            timerExecutorService.scheduleWithFixedDelay(addUnionWarChampionTask, 10, 60, TimeUnit.SECONDS);
        }

//        if (syncAllCrossUnionDetailTask == null) {
//            syncAllCrossUnionDetailTask = new SyncAllCrossUnionDetailTask();
//            timerExecutorService.scheduleWithFixedDelay(syncAllCrossUnionDetailTask, 10, 60, TimeUnit.SECONDS);
//        }

        if (null == shuiHuSyncDrawTask) {
            shuiHuSyncDrawTask = new ShuiHuSyncDrawTask();
            timerExecutorService.scheduleWithFixedDelay(shuiHuSyncDrawTask, 1, 1, TimeUnit.SECONDS);
        }

        if (directMemoryMonitorTask == null) {
            directMemoryMonitorTask = new DirectMemoryMonitorTask();
            timerExecutorService.scheduleWithFixedDelay(directMemoryMonitorTask, 60, 60, TimeUnit.SECONDS);
        }

        if (null == ghostGetAbilityTask) {
            ghostGetAbilityTask = new GhostGetAbilityTask();
            timerExecutorService.scheduleWithFixedDelay(ghostGetAbilityTask, 10, 60, TimeUnit.SECONDS);
        }
        if (null == ghostSyncPlayerActionTask) {
            ghostSyncPlayerActionTask = new GhostSyncPlayerActionTask();
            timerExecutorService.scheduleWithFixedDelay(ghostSyncPlayerActionTask, 0, 1, TimeUnit.SECONDS);
        }
//        if (null == ghostCleanOldDataTask) {
//            ghostCleanOldDataTask = new GhostCleanOldDataTask();
//            timerExecutorService.scheduleWithFixedDelay(ghostCleanOldDataTask, 15, 60, TimeUnit.SECONDS);
//        }

        if (bulletScreenTask == null){
            bulletScreenTask = new BulletScreenTask();
            timerExecutorService.scheduleWithFixedDelay(bulletScreenTask, 10, 5, TimeUnit.SECONDS);
        }

        if (cmdStatisticsTask == null) {
            cmdStatisticsTask = new CmdStatisticsTask();
            timerExecutorService.scheduleWithFixedDelay(cmdStatisticsTask, 10, 10, TimeUnit.MINUTES);
        }

        if (logSaveTask == null){
            logSaveTask = new LogSaveTask();
            timerExecutorService.scheduleWithFixedDelay(logSaveTask, 10, 60, TimeUnit.SECONDS);
        }

        if (cookBoyTimerTask == null) {
            cookBoyTimerTask = new CookBoyTimerTask();
            timerExecutorService.scheduleWithFixedDelay(cookBoyTimerTask, 30, 5, TimeUnit.SECONDS);
        }

        if (chefDuelTimerTask == null) {
            chefDuelTimerTask = new ChefDuelTimerTask();
            timerExecutorService.scheduleWithFixedDelay(chefDuelTimerTask, 30, 5, TimeUnit.SECONDS);
        }

        if (chefDuelWinUpTimerTask == null) {
            chefDuelWinUpTimerTask = new ChefDuelWinUpTimerTask();
            timerExecutorService.scheduleWithFixedDelay(chefDuelWinUpTimerTask, 30, 5, TimeUnit.MINUTES);
        }

        if (cookBoyNoticeTimerTask == null) {
            cookBoyNoticeTimerTask = new CookBoyNoticeTimerTask();
            timerExecutorService.scheduleWithFixedDelay(cookBoyNoticeTimerTask, 30, 1, TimeUnit.SECONDS);
        }

        if (cookBoy2SyncTimerTask == null) {
            cookBoy2SyncTimerTask = new CookBoy2SyncTimerTask();
            timerExecutorService.scheduleWithFixedDelay(cookBoy2SyncTimerTask, 10, 15, TimeUnit.MINUTES);
        }

        if (chefDuelNoticeTimerTask == null) {
            chefDuelNoticeTimerTask = new ChefDuel3NoticeTimerTask();
            timerExecutorService.scheduleWithFixedDelay(chefDuelNoticeTimerTask, 30, 1, TimeUnit.SECONDS);
        }

        if (chefDuel2SyncTimerTask == null) {
            chefDuel2SyncTimerTask = new ChefDuel2SyncTimerTask();
            timerExecutorService.scheduleWithFixedDelay(chefDuel2SyncTimerTask, 10, 15, TimeUnit.MINUTES);
        }

        if (chefDuel2TimerTask == null) {
            chefDuel2TimerTask = new ChefDuel2TimerTask();
            timerExecutorService.scheduleWithFixedDelay(chefDuel2TimerTask, 10, 5, TimeUnit.SECONDS);
        }

        if (null == syncPlayerSceneActionTask) {
            syncPlayerSceneActionTask = new SyncPlayerSceneActionTask();
            timerExecutorService.scheduleWithFixedDelay(syncPlayerSceneActionTask, 1, 1, TimeUnit.SECONDS);
        }

        if (null == goodBanquetSettlementTask) {
            goodBanquetSettlementTask = new GoodBanquetSettlementTask();
            timerExecutorService.scheduleWithFixedDelay(goodBanquetSettlementTask, 30, 3, TimeUnit.SECONDS);
        }

        if (null == goodBanquetSynTask) {
            goodBanquetSynTask = new GoodBanquetSynTask();
            timerExecutorService.scheduleWithFixedDelay(goodBanquetSynTask, 30, 3, TimeUnit.SECONDS);
        }

        addCross3Timer();

        if (null == crossXUserBaseInfoClearTask) {
            crossXUserBaseInfoClearTask = new CrossXUserBaseInfoClearTask();
            timerExecutorService.scheduleWithFixedDelay(crossXUserBaseInfoClearTask, 5, 60, TimeUnit.MINUTES);
        }

        if (springDinnerTimerTask == null) {
            springDinnerTimerTask = new SpringDinnerSyncTask();
            timerExecutorService.scheduleWithFixedDelay(springDinnerTimerTask, 2, 2, TimeUnit.SECONDS);
        }

        if (dfwUnionAdditionTask == null) {
            dfwUnionAdditionTask = new DFWUnionAdditionTask();
            timerExecutorService.scheduleWithFixedDelay(dfwUnionAdditionTask, 10, 3, TimeUnit.SECONDS);
        }

        if (seacraftSouthSeaLockPromotionTask == null) {
            seacraftSouthSeaLockPromotionTask = new SeacraftSouthSeaLockPromotionTask();
            timerExecutorService.scheduleWithFixedDelay(seacraftSouthSeaLockPromotionTask, 15, 5, TimeUnit.SECONDS);
        }

        if(null == crossActivityLogSaveTask){
            crossActivityLogSaveTask = new CrossActivityLogSaveTask();
            timerExecutorService.scheduleWithFixedDelay(crossActivityLogSaveTask, 60, 60, TimeUnit.SECONDS);
        }

        if (dfwSyncDollTask == null) {
            dfwSyncDollTask = new DfwSyncDollTask();
            timerExecutorService.scheduleWithFixedDelay(dfwSyncDollTask, 60, 1, TimeUnit.SECONDS);
        }

        if (crossUnionActivityTaskTask == null) {
            crossUnionActivityTaskTask = new CrossUnionActivityTaskTask();
            timerExecutorService.scheduleWithFixedDelay(crossUnionActivityTaskTask, 10, 3, TimeUnit.SECONDS);
        }

        if (null == unionHonorsRewardSendTask) {
            unionHonorsRewardSendTask = new CrossUnionHonorsRewardSendTask();
            timerExecutorService.scheduleWithFixedDelay(unionHonorsRewardSendTask, 15, 60, TimeUnit.SECONDS);
        }

        if (crossTongBingTimerTask == null) {
            crossTongBingTimerTask = new CrossTongBingTimerTask();
            timerExecutorService.scheduleWithFixedDelay(crossTongBingTimerTask, 10, 10, TimeUnit.SECONDS);
        }

        if (crossChuHanTimerTask == null) {
            crossChuHanTimerTask = new CrossChuHanTimerTask();
            timerExecutorService.scheduleWithFixedDelay(crossChuHanTimerTask, 10, 10, TimeUnit.SECONDS);
        }

        if (crossTonBingTimerTask == null) {
            crossTonBingTimerTask = new CrossTonBingTimerTask();
            timerExecutorService.scheduleWithFixedDelay(crossTonBingTimerTask, 10, 10, TimeUnit.SECONDS);
        }

        if (crossRankUnionWarTask == null) {
            crossRankUnionWarTask = new CrossRankUnionWarTimerTask();
            timerExecutorService.scheduleWithFixedDelay(crossRankUnionWarTask, 1, 1, TimeUnit.SECONDS);
        }
        if (dunHuangShiKuGetActiveUserInfoTask == null) {
            dunHuangShiKuGetActiveUserInfoTask = new CrossDunHuangShiKuGetActiveUserInfoTask();
            timerExecutorService.scheduleWithFixedDelay(dunHuangShiKuGetActiveUserInfoTask, 10, 30, TimeUnit.SECONDS);
        }


        if (tombTask == null) {
            tombTask = new TombTask();
            timerExecutorService.scheduleWithFixedDelay(tombTask, 60, 60, TimeUnit.SECONDS);
        }

        if (tombPathMergeTask == null) {
            tombPathMergeTask = new TombPathMergeTask();
            timerExecutorService.scheduleWithFixedDelay(tombPathMergeTask, 60, 2, TimeUnit.SECONDS);
        }


        if (syncPendingMapTimerTask == null) {
            syncPendingMapTimerTask = new CrossSyncPendingMapTimerTask();
            timerExecutorService.scheduleWithFixedDelay(syncPendingMapTimerTask, 5, 5, TimeUnit.SECONDS);
        }

        if (crossTwinsFastTimerTask == null) {
            crossTwinsFastTimerTask = new CrossTwinsFastTimerTask();
            timerExecutorService.scheduleWithFixedDelay(crossTwinsFastTimerTask, 1000, 500, TimeUnit.MILLISECONDS);
        }

        if (crossTwinsSlowTimerTask == null) {
            crossTwinsSlowTimerTask = new CrossTwinsSlowTimerTask();
            timerExecutorService.scheduleWithFixedDelay(crossTwinsSlowTimerTask, 3, 3, TimeUnit.SECONDS);
        }

        if (peakStrongholdStageChangeTask == null) {
            peakStrongholdStageChangeTask = new CrossPeakStrongholdStageChangeTask();
            timerExecutorService.scheduleWithFixedDelay(peakStrongholdStageChangeTask, 30, 1, TimeUnit.SECONDS);
        }

       /* if (peakStrongholdCreateDefendTask == null) {
            peakStrongholdCreateDefendTask = new CrossPeakStrongholdCreateDefendTask();
            timerExecutorService.scheduleWithFixedDelay(peakStrongholdCreateDefendTask, 30, 5, TimeUnit.SECONDS);
        }*/

        if (peakStrongholdSyncTask == null) {
            peakStrongholdSyncTask = new CrossPeakStrongholdTimerSyncTask();
            timerExecutorService.scheduleWithFixedDelay(peakStrongholdSyncTask, 2, 2, TimeUnit.SECONDS);
        }
        if (peakStrongholdRankSortTask == null) {
            peakStrongholdRankSortTask = new CrossPeakStrongholdRankSortTask();
            timerExecutorService.scheduleWithFixedDelay(peakStrongholdRankSortTask, 2, 3, TimeUnit.SECONDS);
        }
        if (lionDanceTask == null){
            lionDanceTask = new CrossLionDanceTask();
            timerExecutorService.scheduleWithFixedDelay(lionDanceTask, 3, 5, TimeUnit.SECONDS);
        }

        if (langYaMemorialTask == null){
            langYaMemorialTask = new CrossLangYaMemorialTask();
            timerExecutorService.scheduleWithFixedDelay(langYaMemorialTask, 3, 5, TimeUnit.SECONDS);
        }

        if (advanceLoadActivityTask == null) {
            advanceLoadActivityTask = new AdvanceLoadActivityTask();
            timerExecutorService.scheduleWithFixedDelay(advanceLoadActivityTask, 5, 30, TimeUnit.MINUTES);
        }

        if (conditionTimerTask == null){
            conditionTimerTask = new ConditionSyncTask();
            timerExecutorService.scheduleWithFixedDelay(conditionTimerTask, 5, 5, TimeUnit.SECONDS);
        }

        if (crossXiuXianSyncPlaceUserDataTask == null) {
            crossXiuXianSyncPlaceUserDataTask = new CrossXiuXianSyncPlaceUserDataTask();
            timerExecutorService.scheduleWithFixedDelay(crossXiuXianSyncPlaceUserDataTask, 0, 500, TimeUnit.MILLISECONDS);
        }

        if (crossXiuXianSyncRoomOpTask == null) {
            crossXiuXianSyncRoomOpTask = new CrossXiuXianSyncRoomOpTask();
            timerExecutorService.scheduleWithFixedDelay(crossXiuXianSyncRoomOpTask, 0, 3, TimeUnit.SECONDS);
        }

        if (crossXiuXianSyncMountAllotTask == null) {
            crossXiuXianSyncMountAllotTask = new CrossXiuXianSyncMountAllotTask();
            timerExecutorService.scheduleWithFixedDelay(crossXiuXianSyncMountAllotTask, 0, 30, TimeUnit.SECONDS);
        }

        if (crossXiuXianSyncAttackTask == null) {
            crossXiuXianSyncAttackTask = new CrossXiuXianSyncAttackTask();
            timerExecutorService.scheduleWithFixedDelay(crossXiuXianSyncAttackTask, 0, 500, TimeUnit.MILLISECONDS);
        }

        if (crossXiuXianSeizePlaceTask == null) {
            crossXiuXianSeizePlaceTask = new CrossXiuXianSeizePlaceTask();
            timerExecutorService.scheduleWithFixedDelay(crossXiuXianSeizePlaceTask, 0, 1, TimeUnit.SECONDS);
        }

        if (crossXiuXianPvpLockDataTask == null) {
            crossXiuXianPvpLockDataTask = new CrossXiuXianPvpLockDataTask();
            timerExecutorService.scheduleWithFixedDelay(crossXiuXianPvpLockDataTask, 0, 10, TimeUnit.SECONDS);
        }

        if (crossXiuXianPvpActivityCheckTask == null) {
            crossXiuXianPvpActivityCheckTask = new CrossXiuXianPvpActivityCheckTask();
            timerExecutorService.scheduleWithFixedDelay(crossXiuXianPvpActivityCheckTask, 0, 1, TimeUnit.SECONDS);
        }

        if (crossXiuXianPlaceSeizeProduceTask == null) {
            crossXiuXianPlaceSeizeProduceTask = new CrossXiuXianPlaceSeizeProduceTask();
            timerExecutorService.scheduleWithFixedDelay(crossXiuXianPlaceSeizeProduceTask, 0, 1, TimeUnit.SECONDS);
        }

        if (crossXiuXianMountAllotTask == null) {
            crossXiuXianMountAllotTask = new CrossXiuXianMountAllotTask();
            timerExecutorService.scheduleWithFixedDelay(crossXiuXianMountAllotTask, 0, 2, TimeUnit.SECONDS);
        }

        if (crossXiuXianGetServerScoreTask == null) {
            crossXiuXianGetServerScoreTask = new CrossXiuXianGetServerScoreTask();
            timerExecutorService.scheduleWithFixedDelay(crossXiuXianGetServerScoreTask, 0, 10, TimeUnit.SECONDS);
        }

        if (crossXiuXianCheckPlacePingTask == null) {
            crossXiuXianCheckPlacePingTask = new CrossXiuXianCheckPlacePingTask();
            timerExecutorService.scheduleWithFixedDelay(crossXiuXianCheckPlacePingTask, 0, 10, TimeUnit.SECONDS);
        }

        if (crossXiuXianCampScoreSyncTask == null) {
            crossXiuXianCampScoreSyncTask = new CrossXiuXianCampScoreSyncTask();
            timerExecutorService.scheduleWithFixedDelay(crossXiuXianCampScoreSyncTask, 0, 1, TimeUnit.SECONDS);
        }

        if (crossXiuXianGenCampTask == null) {
            crossXiuXianGenCampTask = new CrossXiuXianGenCampTask();
            timerExecutorService.scheduleWithFixedDelay(crossXiuXianGenCampTask, 0, 1, TimeUnit.MINUTES);
        }

        if (crossXiuXianNpcActionTask == null) {
            crossXiuXianNpcActionTask = new CrossXiuXianNpcActionTask();
            timerExecutorService.scheduleWithFixedDelay(crossXiuXianNpcActionTask, 0, 200, TimeUnit.MILLISECONDS);
        }

        //山河乐宴
        if (crossFeastSyncRoomOpTask == null) {
            crossFeastSyncRoomOpTask = new CrossFeastSyncRoomOpTask();
            timerExecutorService.scheduleWithFixedDelay(crossFeastSyncRoomOpTask, 0, 100, TimeUnit.MILLISECONDS);
        }

        if (crossFeastSyncAttackTask == null) {
            crossFeastSyncAttackTask = new CrossFeastSyncAttackTask();
            timerExecutorService.scheduleWithFixedDelay(crossFeastSyncAttackTask, 0, 500, TimeUnit.MILLISECONDS);
        }

        if (crossFeastPvpLockDataTask == null) {
            crossFeastPvpLockDataTask = new CrossFeastPvpRobotTask();
            timerExecutorService.scheduleWithFixedDelay(crossFeastPvpLockDataTask, 0, 10, TimeUnit.SECONDS);
        }

        if (crossFeastMountAllotTask == null) {
            crossFeastMountAllotTask = new CrossFeastMountAllotTask();
            timerExecutorService.scheduleWithFixedDelay(crossFeastMountAllotTask, 0, 2, TimeUnit.SECONDS);
        }

        if (crossFeastCheckPlacePingTask == null) {
            crossFeastCheckPlacePingTask = new CrossFeastCheckPlacePingTask();
            timerExecutorService.scheduleWithFixedDelay(crossFeastCheckPlacePingTask, 0, 10, TimeUnit.SECONDS);
        }

        if (feastPvpSyncPositionTask == null) {
            feastPvpSyncPositionTask = new FeastPvpSyncPositionTask();
            timerExecutorService.scheduleWithFixedDelay(feastPvpSyncPositionTask, 0, 33, TimeUnit.MILLISECONDS);
        }

        if (crossFeastPvpNpcTask == null) {
            crossFeastPvpNpcTask = new CrossFeastPvpNpcTask();
            timerExecutorService.scheduleWithFixedDelay(crossFeastPvpNpcTask, 0, 100, TimeUnit.MILLISECONDS);
        }

        if (crossFeastSyncMountAllotTask == null) {
            crossFeastSyncMountAllotTask = new CrossFeastSyncMountAllotTask();
            timerExecutorService.scheduleWithFixedDelay(crossFeastSyncMountAllotTask, 0, 30, TimeUnit.SECONDS);
        }

        if (feastPvpReviveTask == null) {
            feastPvpReviveTask = new FeastPvpReviveTask();
            timerExecutorService.scheduleWithFixedDelay(feastPvpReviveTask, 0, 1, TimeUnit.SECONDS);
        }

        if (feastOutputTask == null) {
            feastOutputTask = new FeastOutputTask();
            timerExecutorService.scheduleWithFixedDelay(feastOutputTask, 0, 1, TimeUnit.SECONDS);
        }

        if (feastPvpTask == null) {
            feastPvpTask = new FeastPvpTask();
            timerExecutorService.scheduleWithFixedDelay(feastPvpTask, 0, 100, TimeUnit.MILLISECONDS);
        }

        if (feastCheckBulletCollisionTask == null) {
            feastCheckBulletCollisionTask = new FeastCheckUserCollisionTask();
            timerExecutorService.scheduleWithFixedDelay(feastCheckBulletCollisionTask, 0, 100, TimeUnit.MILLISECONDS);
        }

        if (fiveHeroSyncTask == null) {
            fiveHeroSyncTask = new FiveHeroSyncTask();
            timerExecutorService.scheduleWithFixedDelay(fiveHeroSyncTask, 0, 3, TimeUnit.SECONDS);
        }

        if (crossKuangBattleTask == null) {
            crossKuangBattleTask = new CrossKuangBattleTask();
            timerExecutorService.scheduleWithFixedDelay(crossKuangBattleTask, 0, 100, TimeUnit.MILLISECONDS);
        }

        if(null == crossUnionMaxAbilitySyncTask){
            crossUnionMaxAbilitySyncTask = new CrossUnionMaxAbilitySyncTask();
            timerExecutorService.scheduleWithFixedDelay(crossUnionMaxAbilitySyncTask, 300, 10, TimeUnit.SECONDS);
        }
        if (null == crossFlowerStudyStartRoomTask){
            crossFlowerStudyStartRoomTask = new CrossFlowerStudyStartRoomTask();
            timerExecutorService.scheduleWithFixedDelay(crossFlowerStudyStartRoomTask, 200, 200, TimeUnit.MILLISECONDS);
        }
        if (null == crossFlowerStudyFinishRoomTask){
            crossFlowerStudyFinishRoomTask = new CrossFlowerStudyFinishRoomTask();
            timerExecutorService.scheduleWithFixedDelay(crossFlowerStudyFinishRoomTask, 200, 200, TimeUnit.MILLISECONDS);
        }

        if (null == crossFlowerStudySessionChangeTask){
            crossFlowerStudySessionChangeTask = new CrossFlowerStudySessionChangeTask();
            timerExecutorService.scheduleWithFixedDelay(crossFlowerStudySessionChangeTask, 2, 1, TimeUnit.SECONDS);
        }


        if (null == newMonopolyMarketTask){
            newMonopolyMarketTask = new CrossNewMonopolyMarketTask();
            timerExecutorService.scheduleWithFixedDelay(newMonopolyMarketTask, 30, 20, TimeUnit.SECONDS);
        }

        if (daoMuPvpTask == null) {
            daoMuPvpTask = new DaoMuPvpTask();
            timerExecutorService.scheduleWithFixedDelay(daoMuPvpTask, 0, 100, TimeUnit.MILLISECONDS);
        }

        if (daoMuCheckBulletCollisionTask == null) {
            daoMuCheckBulletCollisionTask = new DaoMuCheckBulletCollisionTask();
            timerExecutorService.scheduleWithFixedDelay(daoMuCheckBulletCollisionTask, 0, 100, TimeUnit.MILLISECONDS);
        }

        if (daoMuCheckMonsterCollisionTask == null) {
            daoMuCheckMonsterCollisionTask = new DaoMuCheckMonsterCollisionTask();
            timerExecutorService.scheduleWithFixedDelay(daoMuCheckMonsterCollisionTask, 0, 100, TimeUnit.MILLISECONDS);
        }

        if (daoMuCreateBulletTask == null) {
            daoMuCreateBulletTask = new DaoMuCreateBulletTask();
            timerExecutorService.scheduleWithFixedDelay(daoMuCreateBulletTask, 0, 500, TimeUnit.MILLISECONDS);
        }

        if (daoMuPvpNpcTask == null) {
            daoMuPvpNpcTask = new DaoMuPvpNpcTask();
            timerExecutorService.scheduleWithFixedDelay(daoMuPvpNpcTask, 0, 100, TimeUnit.MILLISECONDS);
        }

        if (daoMuPvpRefreshGoodsTask == null) {
            daoMuPvpRefreshGoodsTask = new DaoMuPvpRefreshGoodsTask();
            timerExecutorService.scheduleWithFixedDelay(daoMuPvpRefreshGoodsTask, 0, 1, TimeUnit.SECONDS);
        }

        if (daoMuPvpRecycleGoodsTask == null) {
            daoMuPvpRecycleGoodsTask = new DaoMuPvpRecycleGoodsTask();
            timerExecutorService.scheduleWithFixedDelay(daoMuPvpRecycleGoodsTask, 0, 1, TimeUnit.SECONDS);
        }

        if (daoMuPvpReviveTask == null) {
            daoMuPvpReviveTask = new DaoMuPvpReviveTask();
            timerExecutorService.scheduleWithFixedDelay(daoMuPvpReviveTask, 0, 1, TimeUnit.SECONDS);
        }

        if (daoMuPvpRoomTask == null) {
            daoMuPvpRoomTask = new DaoMuPvpRoomTask();
            timerExecutorService.scheduleWithFixedDelay(daoMuPvpRoomTask, 0, 1, TimeUnit.SECONDS);
        }

        if (daoMuPvpAliveRankChangeTask == null) {
            daoMuPvpAliveRankChangeTask = new DaoMuPvpAliveRankChangeTask();
            timerExecutorService.scheduleWithFixedDelay(daoMuPvpAliveRankChangeTask, 0, 1, TimeUnit.SECONDS);
        }

        if (daoMuPvpSyncPositionTask == null) {
            daoMuPvpSyncPositionTask = new DaoMuPvpSyncPositionTask();
            timerExecutorService.scheduleWithFixedDelay(daoMuPvpSyncPositionTask, 0, 33, TimeUnit.MILLISECONDS);
        }

        if (daoMuPvpSyncRemoveRoomItemTask == null) {
            daoMuPvpSyncRemoveRoomItemTask = new DaoMuPvpSyncRemoveRoomItemTask();
            timerExecutorService.scheduleWithFixedDelay(daoMuPvpSyncRemoveRoomItemTask, 0, 33, TimeUnit.MILLISECONDS);
        }

        if (crossJinLiDrawTask == null) {
            crossJinLiDrawTask = new CrossJinLiDrawTask();
            timerExecutorService.scheduleWithFixedDelay(crossJinLiDrawTask, 0, 5, TimeUnit.SECONDS);
        }

        if (crossMusicRoomRankTask == null) {
            crossMusicRoomRankTask = new CrossMusicRoomRankTask();
            timerExecutorService.scheduleWithFixedDelay(crossMusicRoomRankTask, 30, 1, TimeUnit.SECONDS);
        }
        if (crossJiuZhouDebugTask == null) {
            crossJiuZhouDebugTask = new CrossJiuZhouDebugTask();
            timerExecutorService.scheduleWithFixedDelay(crossJiuZhouDebugTask, 0, 10, TimeUnit.SECONDS);
        }

        if (crossJiuZhouRoomLogicTask == null) {
            crossJiuZhouRoomLogicTask = new CrossJiuZhouRoomLogicTask();
            timerExecutorService.scheduleWithFixedDelay(crossJiuZhouRoomLogicTask, 0, 1, TimeUnit.SECONDS);
        }

        if (null == crossJiuZhouStageTask){
            crossJiuZhouStageTask = new CrossJiuZhouStageTask();
            timerExecutorService.scheduleWithFixedDelay(crossJiuZhouStageTask, 0, 1, TimeUnit.SECONDS);
        }

        if (null == crossJiuZhouCheckGuessResultTask){
            crossJiuZhouCheckGuessResultTask = new CrossJiuZhouCheckGuessResultTask();
            timerExecutorService.scheduleWithFixedDelay(crossJiuZhouCheckGuessResultTask, 10, 30, TimeUnit.SECONDS);
        }

        if (crossJiuZhouReleaseMemoryTask == null) {
            crossJiuZhouReleaseMemoryTask = new CrossJiuZhouReleaseMemoryTask();
            timerExecutorService.scheduleWithFixedDelay(crossJiuZhouReleaseMemoryTask, 0, 1, TimeUnit.MINUTES);
        }

        if (crossJiuZhouPopularitySyncTask == null) {
            crossJiuZhouPopularitySyncTask = new CrossJiuZhouPopularitySyncTask();
            timerExecutorService.scheduleWithFixedDelay(crossJiuZhouPopularitySyncTask, 0, 500, TimeUnit.MILLISECONDS);
        }

        if (crossMallDayBuyTask == null) {
            crossMallDayBuyTask = new CrossMallDayBuyTask();
            timerExecutorService.scheduleWithFixedDelay(crossMallDayBuyTask, 20, 5, TimeUnit.SECONDS);
        }
        if (null == crossAutoLogSaveTask) {
            crossAutoLogSaveTask = new CrossAutoLogSaveTask();
            timerExecutorService.scheduleWithFixedDelay(crossAutoLogSaveTask, 60, 30, TimeUnit.SECONDS);
        }

        if (zhenHuanPromotionTask == null) {
            zhenHuanPromotionTask = new CrossZhenHuanPromotionTask();
            timerExecutorService.scheduleWithFixedDelay(zhenHuanPromotionTask, 20, 5, TimeUnit.SECONDS);
        }

        if (zhenHuanThirdProcessDebugTask == null) {
            zhenHuanThirdProcessDebugTask = new CrossZhenHuanThirdProcessDebugTask();
            timerExecutorService.scheduleWithFixedDelay(zhenHuanThirdProcessDebugTask, 0, 10, TimeUnit.SECONDS);
        }

        if (zhenHuanThirdProcessBanquetLogicTask == null) {
            zhenHuanThirdProcessBanquetLogicTask = new CrossZhenHuanThirdProcessBanquetLogicTask();
            timerExecutorService.scheduleWithFixedDelay(zhenHuanThirdProcessBanquetLogicTask, 0, 1, TimeUnit.SECONDS);
        }

        if (zhenHuanThirdProcessBanquetSyncTask == null) {
            zhenHuanThirdProcessBanquetSyncTask = new CrossZhenHuanThirdProcessBanquetSyncTask();
            timerExecutorService.scheduleWithFixedDelay(zhenHuanThirdProcessBanquetSyncTask, 0, 1, TimeUnit.SECONDS);
        }

        if (zhenHuanSecondProcessTask == null) {
            zhenHuanSecondProcessTask  = new CrossZhenHuanSecondProcessTask();
            timerExecutorService.scheduleWithFixedDelay(zhenHuanSecondProcessTask, 0, 1, TimeUnit.SECONDS);
        }

        if (crossBiaoJuTask == null) {
            crossBiaoJuTask = new CrossBiaoJuTask();
            timerExecutorService.scheduleWithFixedDelay(crossBiaoJuTask, 10, 1, TimeUnit.SECONDS);
        }

        if (crossBiaoJuRankTask == null) {
            crossBiaoJuRankTask = new CrossBiaoJuRankTask();
            timerExecutorService.scheduleWithFixedDelay(crossBiaoJuRankTask, 10, 10, TimeUnit.SECONDS);
        }

        if (null == cross2DataAnalyticsTask){
            cross2DataAnalyticsTask = new Cross2DataAnalyticsTask();
            timerExecutorService.scheduleWithFixedDelay(cross2DataAnalyticsTask, 10, 10, TimeUnit.SECONDS);
        }

        if (checkDeadLockTask == null) {
            checkDeadLockTask = new CheckDeadLockTask();
            timerExecutorService.scheduleWithFixedDelay(checkDeadLockTask, 0, 30, TimeUnit.SECONDS);
        }

        if (crossSummerQuizTask == null){
            crossSummerQuizTask = new CrossSummerQuizTask();
            timerExecutorService.scheduleWithFixedDelay(crossSummerQuizTask, 0, 10, TimeUnit.SECONDS);
        }

        if (crossSummerGamesTask == null){
            crossSummerGamesTask = new CrossSummerGamesTask();
            timerExecutorService.scheduleWithFixedDelay(crossSummerGamesTask, 0, 30, TimeUnit.SECONDS);
        }

        if (xingYouShanShuiTask == null){
            xingYouShanShuiTask = new XingYouShanShuiTask();
            timerExecutorService.scheduleWithFixedDelay(xingYouShanShuiTask, 0, 15, TimeUnit.SECONDS);
        }

        if (xingYouShanShuiSyncTask == null){
            xingYouShanShuiSyncTask = new XingYouShanShuiSyncTask();
            timerExecutorService.scheduleWithFixedDelay(xingYouShanShuiSyncTask, 0, 3, TimeUnit.SECONDS);
        }

        if (xingYouShanShuiSettleTask == null){
            xingYouShanShuiSettleTask = new XingYouShanShuiSettleTask();
            timerExecutorService.scheduleWithFixedDelay(xingYouShanShuiSettleTask, 0, 1, TimeUnit.SECONDS);
        }


        if (null == sonHaiDailyResetEggTask){
            sonHaiDailyResetEggTask = new SonHaiDailyResetEggTask();
            timerExecutorService.scheduleWithFixedDelay(sonHaiDailyResetEggTask, 0, 1, TimeUnit.MINUTES);
        }

        if (null == sonHaiNotifyServerSyncVipAveTask){
            sonHaiNotifyServerSyncVipAveTask = new SonHaiNotifyServerSyncVipAveTask();
            timerExecutorService.scheduleWithFixedDelay(sonHaiNotifyServerSyncVipAveTask, 0, 1, TimeUnit.MINUTES);
        }

        if (null == sonHaiSyncUpdateTeamScoreTask){
            sonHaiSyncUpdateTeamScoreTask = new SonHaiSyncUpdateTeamScoreTask();
            timerExecutorService.scheduleWithFixedDelay(sonHaiSyncUpdateTeamScoreTask, 0, 1, TimeUnit.MINUTES);
        }

        if (null == sonHaiBfEggRewardTask){
            sonHaiBfEggRewardTask = new SonHaiBfEggRewardTask();
            timerExecutorService.scheduleWithFixedDelay(sonHaiBfEggRewardTask, 0, 1, TimeUnit.MINUTES);
        }
        if (null == sonHaiRestRegionTask){
            sonHaiRestRegionTask = new SonHaiRestRegionTask();
            timerExecutorService.scheduleWithFixedDelay(sonHaiRestRegionTask, 0, 1, TimeUnit.SECONDS);
        }

        if (crossHsIslandDebugTask == null) {
            crossHsIslandDebugTask = new CrossHsIslandDebugTask();
            timerExecutorService.scheduleWithFixedDelay(crossHsIslandDebugTask, 0, 10, TimeUnit.SECONDS);
        }
        if (crossHsIslandBossTask == null) {
            crossHsIslandBossTask = new CrossHsIslandBossTask();
            timerExecutorService.scheduleWithFixedDelay(crossHsIslandBossTask, 0, 1, TimeUnit.SECONDS);
        }
        if (crossHsIslandBattleFieldSyncTask == null) {
            crossHsIslandBattleFieldSyncTask = new CrossHsIslandBattleFieldSyncTask();
            timerExecutorService.scheduleWithFixedDelay(crossHsIslandBattleFieldSyncTask, 0, 100, TimeUnit.MILLISECONDS);
        }
        if (crossHsIslandUpdateUnionAcEndActivityTask == null) {
            crossHsIslandUpdateUnionAcEndActivityTask = new CrossHsIslandUpdateUnionAcEndActivityTask();
            timerExecutorService.scheduleWithFixedDelay(crossHsIslandUpdateUnionAcEndActivityTask, 0, 1, TimeUnit.MINUTES);
        }
        if (crossHsIslandBattleFieldCleanTask == null) {
            crossHsIslandBattleFieldCleanTask = new CrossHsIslandBattleFieldCleanTask();
            timerExecutorService.scheduleWithFixedDelay(crossHsIslandBattleFieldCleanTask, 0, 1, TimeUnit.MINUTES);
        }
        if (crossHsIslandSendRewardTask == null) {
            crossHsIslandSendRewardTask = new CrossHsIslandSendRewardTask();
            timerExecutorService.scheduleWithFixedDelay(crossHsIslandSendRewardTask, 0, 1, TimeUnit.MINUTES);
        }

        if (null == crossHorseRunTask){
            crossHorseRunTask = new CrossHorseRunTask();
            timerExecutorService.scheduleWithFixedDelay(crossHorseRunTask, 5, 1, TimeUnit.SECONDS);
        }
        return true;

    }

    /**
     * 添加跨地域专用跨服才有的定时器
     */
    private static void addCross3Timer() {

        if (!CrossChannelHelper.isCross3(CrossBattleServer.getInstance().getServerId())) {
            return;
        }

        if (null == checkCross3ChannelConnTask) {
            checkCross3ChannelConnTask = new CheckCross3ChannelConnTask();
            timerExecutorService.scheduleWithFixedDelay(checkCross3ChannelConnTask, 5, 5, TimeUnit.SECONDS);
        }
        if (null == cross3XRankTask) {
            cross3XRankTask = new Cross3XRankTask();
            timerExecutorService.scheduleWithFixedDelay(cross3XRankTask, 10, 2, TimeUnit.SECONDS);
        }
        if (null == cross3XServerNameTask) {
            cross3XServerNameTask = new Cross3XServerNameTask();
            timerExecutorService.scheduleWithFixedDelay(cross3XServerNameTask, 3, 15, TimeUnit.MINUTES);
        }
        if (null == cross3EnterNameTask){
            cross3EnterNameTask = new Cross3EnterNameTask();
            timerExecutorService.scheduleWithFixedDelay(cross3EnterNameTask, 1, 5, TimeUnit.MINUTES);
        }

        //跨域百花争艳 妙音坊冲榜
        if (null == crossChannelMusicRoomRankTask){
            crossChannelMusicRoomRankTask = new CrossChannelMusicRoomRankTask();
            timerExecutorService.scheduleWithFixedDelay(crossChannelMusicRoomRankTask, 30, 1, TimeUnit.SECONDS);
        }

    }

    public static void stop(){
        cancelTask(crossRankUnionWarTask);
        cancelTask(cross3EnterNameTask);
        cancelTask(newMonopolyMarketTask);



    }

    private static void cancelTask(GeneralTask task) {
        if (null != task) {
            task.cancel(false);
        }
    }
}
